pygrub: trap exception when python module import fails
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 7 Sep 2009 12:50:55 +0000 (13:50 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 7 Sep 2009 12:50:55 +0000 (13:50 +0100)
commitfdb26f82e7aa9b4370e6563a990c498d86b7d44c
tree5a94f292ba703752dda77fa9a025b70cb232d63f
parent4fe3160cbc7c4e71a85db069186ca26407acba77
pygrub: trap exception when python module import fails

Fix the issue when importing 'crypt' module or crypt.crypt fails in
pygrub. The exception is written on the same line like "Failed!"
message but only if there is an exception. If there is no exception,
we don't bother users with details (probably the password they entered
was wrong) so we just display "Failed!" message. Also, the code for
hasPassword() was rewritten not to have try/except block here.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
tools/pygrub/src/GrubConf.py
tools/pygrub/src/pygrub